<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title></title>
</head>

<body>
    <div class="content"></div>
    <script src="../src/cache.js"></script>
    <script>
        window.onload = function() {
            var cache = new Cache('localStorage');
            cache.debug.enable();
            cache.set('test', {
                'name': '胡海华'
            }, {
                'type': 's',
                'delay': 1
            });
            cache.set('test1', {
                'name': '胡意'
            });
            localStorage.setItem('test2', 'haha');
            cache.set('test2', 'haha1');
            cache.update('test2', {
                'name': 'haha2'
            }, {
                'type': 'd',
                'delay': 1
            });
            setTimeout(function() {
                cache.clear('exp');
            }, 3000);

            console.log(cache.get('test2'));
        }
    </script>
</body>

</html>